﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Net;
using System.Net.Http;
using System.Web.Http;
using System.Web.Security;
using Project.API.Models;
using Project.BLL;

namespace Project.API.Controllers
{
    public class RoleController : ApiController
    {
        // GET: api/Role
        public List<RoleDto> Get()
        {
            var data = new RolesBll().Query();
            var list = from d in data
                       select new RoleDto
                       {
                           roleID = d.roleID,
                           roleName=d.roleName,
                           deptID=d.deptID,
                           type=d.type,
                           remark=d.remark,
                           lastTime=d.lastTime
                       };
            return list.ToList();
        }

        // GET: api/Role/5
        public string Get(int id)
        {
            return "value";
        }

        // POST: api/Role
        public void Post([FromBody]string value)
        {
        }

        // PUT: api/Role/5
        public void Put(int id, [FromBody]string value)
        {
        }

        // DELETE: api/Role/5
        public void Delete(int id)
        {
        }
    }
}
